package com.wangcanxuan.www.util;


import java.io.IOException;
import java.io.InputStream;
import java.util.logging.LogManager;
import java.util.logging.Logger;

/**
 * 日志工具类
 *
 * @author HHLJ
 * @date 2022/03/17
 */
public class LoggerUtil {

    private LoggerUtil(){

    }

    static {
        InputStream inputStream = LoggerUtil.class.getClassLoader().getResourceAsStream("logging.properties");
        LogManager logManager = LogManager.getLogManager();
        try {
            logManager.readConfiguration(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * 全局logger
     */
    private static final Logger logger = Logger.getLogger("MyLogger");

    public static Logger getLogger() {
        return logger;
    }

}
